﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows;

namespace TimHeuer.Expression.FtpPublish
{
    public class PublishData : INotifyPropertyChanged
    {
        #region Member Variables
        private string _server;
        private string _userName;
        private string _password;
        private string _defaultDirectory;
        private bool _savePassword = false;
        private string _generatedHtml = string.Empty;
        private string _baseUri = string.Empty;
        private bool _useProxy = true;
        #endregion

        #region Public Properties
        public bool UseProxy
        {
            get { return _useProxy; }
            set
            {
                _useProxy = value;
                this.OnPropertyChanged("UseProxy");
            }
        }
        public string DefaultDirectory
        {
            get { return _defaultDirectory; }
            set
            {
                _defaultDirectory = value;
                this.OnPropertyChanged("DefaultDirectory");
            }
        }
        public bool SavePassword
        {
            get { return _savePassword; }
            set
            {
                _savePassword = value;
                this.OnPropertyChanged("SavePassword");
            }
        }
        public string GeneratedHtml
        {
            get { return _generatedHtml; }
            set
            {
                _generatedHtml = value;
                this.OnPropertyChanged("GeneratedHtml");
                this.OnPropertyChanged("ObjectTagGenerated");
            }
        }
        public string BaseUri
        {
            get { return _baseUri; }
            set
            {
                _baseUri = value;
                this.OnPropertyChanged("BaseUri");
            }
        }
        public string ServerAddress
        {
            get { return _server; }
            set
            {
                _server = value;
                this.OnPropertyChanged("ServerAddress");
            }
        }
        public string UserName
        {
            get { return _userName; }
            set
            {
                _userName = value;
                this.OnPropertyChanged("UserName");
            }
        }
        public string Password
        {
            get { return _password; }
            set
            {
                _password = value;
                this.OnPropertyChanged("Password");
            }
        }
        #endregion

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region Private Methods
        private void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
}